import { createStore } from 'vuex'

const MEMBER = "MEMBER"

export default createStore({
  state: {
    member:window.SessionStorage.get(MEMBER) || {}
  },
  getters: {
  },
  // 相当于java的setter方法
  mutations: {
    setMember(state,member){
      state.member = member
      // 将会员信息保存到SessionStorage中
      window.SessionStorage.set(MEMBER,member)
    }
  },
  actions: {
  },
  modules: {
  }
})
